﻿using Newtonsoft.Json;
using System.Net;

namespace Signit.Sdk.Http
{
    partial class HttpClientSync
    {
        public class Response
        {
            public HttpStatusCode Code { get; set; }
            public string Content { get; set; }
            public bool IsSuccessStatusCode { get; internal set; }

            public T GetObject<T>()
            {
                return string.IsNullOrWhiteSpace(Content)
                    ? default(T)
                    : JsonConvert.DeserializeObject<T>(Content);
            }
        }
    }
}
